<template>
   <ul class="box_pro">
      <li v-for="(item, index) in prolist" :key="index" @click="toDetail(item.proid)">
        <img :src="item.pro_pic" alt="">
        <div class="box_pro_content">
          <h5>{{item.pro_introduce}}</h5>
          <div>
            <span>{{item.clinic_name}}</span>
            <span>{{item.distance + 'km'}}</span>
          </div>
          <div>
            <span>{{'￥' + item.pro_price}}</span>
            <span>{{item.subscribe + '人预约'}}</span>
          </div>
        </div>
      </li>
    </ul>
</template>

<script>
import Vue from 'vue'
import { Toast } from 'vant'
Vue.use(Toast)
export default {
  props: {
    prolist: {
      type: Array,
      default: () => {
        return []
      }
    }
  },
  methods: {
    toDetail (proid) {
      this.$router.push({ path: '/proDetail', query: { proid } })
    }
  }
}
</script>

<style lang="scss" scoped>
.box_pro {
  width: 100%;
  height: 1.32rem;
  li {
    padding: 0.18rem 0.15rem;
    width: 100%;
    height: 1.32rem;
    border-bottom: 1px solid #f6f6f6;
    img {
      width: 0.92rem;
      height: 0.96rem;
      margin-right: 0.18rem;
      float: left;
    }
    .box_pro_content {
      width: 2.35rem;
      height: 0.96rem;
      float: left;
      h5 {
        width: 100%;
        height: 0.36rem;
        line-height: 0.18rem;
        font-size: 0.14rem;
        font-weight: normal;
        color: #464646;
        margin-bottom: 0.16rem;
        text-overflow: -o-ellipsis-lastline;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
      }
      div:nth-of-type(1) {
        width: 100%;
        height: 0.14rem;
        margin-bottom: 0.14rem;
        line-height: 0.14rem;
        span {
          font-size: 0.12rem;
          color: #808080;
          height: 0.12rem;
        }
        span:nth-of-type(1) {
          float: left;
        }
        span:nth-of-type(2) {
          float: right;
        }
      }
      div:nth-of-type(2) {
        width: 100%;
        height: 0.16rem;
        line-height: 0.16rem;
        span:nth-of-type(1) {
          float: left;
          color: #FF5959;
          font-size: 0.16rem;
        }
        span:nth-of-type(2) {
          float: right;
          color: #808080;
          font-size: 0.12rem;
        }
      }
    }
  }
}
</style>
